package com.maomao.service.impl;

import com.maomao.entitiy.User;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author mao
 * @date 2025-06-10- 10:49
 * @descript
 */
@Service
public class UserServiceImpl {

    @Cacheable(value = "users", key = "#id")
    public User getUserById(Long id) {
        // 模拟从数据库中获取用户数据
        User user = new User();
        user.setId(111L);
        user.setName("User " + id);
        return user;
    }

}
